package ai.peanut.one.api.controller;

import ai.peanut.one.service.IReAndAutoService;
import ai.peanut.one.service.impl.ReAndAutoServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class AuAndReController {

    @Autowired
    @Qualifier("reAndAutoServiceTwoImpl")
    IReAndAutoService iReAndAutoService ;
    @Autowired
    @Qualifier("reAndAutoServiceTwoImpl")
    IReAndAutoService iReAndAutoServiceAu2 ;


    @Resource(name="reAndAutoServiceImpl")
    IReAndAutoService iReAndAutoServiceRe ;
    @Resource(type= ReAndAutoServiceImpl.class)
    IReAndAutoService iReAndAutoServiceReType ;


    @Resource(name="reAndAutoServiceTwoImpl")
    IReAndAutoService iReAndAutoServiceReToTwo ;

    @RequestMapping("/auu")
    public void testAuAndRe(){
        iReAndAutoService.test();
        iReAndAutoServiceRe.test();
        System.out.println(iReAndAutoService == iReAndAutoServiceRe);
        System.out.println(iReAndAutoService == iReAndAutoServiceAu2);
        System.out.println(iReAndAutoService == iReAndAutoServiceReToTwo)   ;

        System.out.println(iReAndAutoServiceReType==iReAndAutoServiceRe);
    }
}
